<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script type="text/javascript" src="js/vue.min.js"></script>
<style type="text/css">
.red{color:red;}
.orange{color:red;}
.cyan{color:cyan;}
.green{color:green;}
</style>
</head>
<body>
<div id="myApp">
<h3>v-class</h3> 
<input type="text" v-model="curClass">
<hr> 
<div v-bind:class="curClass">{{curClass}}</div>
<hr>
<h3>绑定两个样式</h3>
<div v-bind:class="{'red':classOff,'cyan':ok}">{{curClass}}</div> 
<hr>
<div v-bind:class="['red','cyan']">{{curClass}}</div>
<h3>结合三目运算符</h3>
<div v-bind:class="['red',ok?'cyan':'']">{{curClass}}</div>
</div>
<script type="text/javascript">
var myApp = new Vue({
	el:"#myApp",
	data:{
		classOff:true,
		ok:true,
		curClass:'red'
	}
});
</script>
</body>
</html>